package com.th.supcom.pds.phamapply.client.widget.inpharmacyreturn;

import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.DateTimePropertyEditor;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.th.supcom.pds.common.client.model.CodeConstants;
import com.th.supcom.pds.common.client.model.PtsPaiAdtLogModel;
import com.th.supcom.pds.phamapply.client.model.InpPhamApplyPatInfoModel;

/**
 * 住院药房退药文本域组件集合
 * 
 * @author yzhang
 */
public class NurseReturnFields
{
    /** 患者ID */
    private TextField <String> m_patiIdField;
    /** 床号 */
    private TextField <String> m_BedNoField;
    /** 就诊次数 */
    private ComboBox <InpPhamApplyPatInfoModel> m_watchTimes;

    private ListStore <InpPhamApplyPatInfoModel> m_patiInfoListStore;

    /** 患者所在病区 */
    private ComboBox <PtsPaiAdtLogModel> m_patiAdtComboBox;

    /** 患者所在病区store */
    private ListStore <PtsPaiAdtLogModel> m_patiAdtListStore;

    /** 开始时间框 */
    private DateField m_beginField;

    /** 结束时间框 */
    private DateField m_endField;
    /** 姓名 */
    private TextField <String> m_patiNameField;
    /** 患者ID 展示用 */
    private TextField <String> m_patiIdForDisplayField;
    /** 性别 */
    private TextField <String> m_sexField;
    /** 床号 展示用 */
    private TextField <String> m_BedNoForDisplayField;
    /** 入科时间 */
    private TextField <String> m_deptAdmissionDateField;
    /** 预交金 */
    private TextField <Double> m_prepaidField;
    /** 在院科室 */
    private TextField <String> m_deptAdmissionNameField;
    /** 费别名称 */
    private TextField <String> m_chargeTypeName;
    /** 就诊次数 */
    private TextField <String> m_watchTimesForDisplay;
    /** 在科天数 */
    private TextField <Integer> m_deptAdmissionDays;

    /**
     * 构造方法
     */
    public NurseReturnFields ()
    {
        createTextFields ();
    }

    private void createTextFields ()
    {
        m_BedNoField = new TextField <String> ();
        m_BedNoField.setFieldLabel ("床号");

        m_patiIdField = new TextField <String> ();
        m_patiIdField.setFieldLabel ("患者ID");

        m_patiInfoListStore = new ListStore <InpPhamApplyPatInfoModel> ();
        m_watchTimes = new ComboBox <InpPhamApplyPatInfoModel> ();
        m_watchTimes.setFieldLabel ("就诊次数");
        m_watchTimes.setTriggerAction (TriggerAction.ALL);
        m_watchTimes.setDisplayField ("watchTimes");
        m_watchTimes.setStore (m_patiInfoListStore);

        m_patiAdtListStore = new ListStore <PtsPaiAdtLogModel> ();
        m_patiAdtComboBox = new ComboBox <PtsPaiAdtLogModel> ();
        m_patiAdtComboBox.setFieldLabel ("病区");
        m_patiAdtComboBox.setDisplayField ("wardName");
        m_patiAdtComboBox.setTriggerAction (TriggerAction.ALL);
        m_patiAdtComboBox.setStore (m_patiAdtListStore);

        m_patiAdtComboBox.setEditable (false);
        m_beginField = new DateField ();
        m_beginField.setPropertyEditor (new DateTimePropertyEditor (CodeConstants.DATE_FORMAT_YYYY_MM_DD));
        m_beginField.setEditable (false);
        m_beginField.setFieldLabel ("开始");

        m_endField = new DateField ();
        m_endField.setPropertyEditor (new DateTimePropertyEditor (CodeConstants.DATE_FORMAT_YYYY_MM_DD));
        m_endField.setEditable (false);
        m_endField.setFieldLabel ("到");

        m_patiNameField = new TextField <String> ();
        m_patiNameField.setFieldLabel ("姓名");
        m_patiNameField.setEnabled (false);

        m_patiIdForDisplayField = new TextField <String> ();
        m_patiIdForDisplayField.setFieldLabel ("患者ID");
        m_patiIdForDisplayField.setEnabled (false);

        m_sexField = new TextField <String> ();
        m_sexField.setFieldLabel ("性别");
        m_sexField.setEnabled (false);

        m_BedNoForDisplayField = new TextField <String> ();
        m_BedNoForDisplayField.setFieldLabel ("床号");
        m_BedNoForDisplayField.setEnabled (false);

        m_deptAdmissionDateField = new TextField <String> ();
        m_deptAdmissionDateField.setFieldLabel ("入科时间");
        m_deptAdmissionDateField.setEnabled (false);

        m_prepaidField = new TextField <Double> ();
        m_prepaidField.setFieldLabel ("预交金");
        m_prepaidField.setEnabled (false);

        m_deptAdmissionNameField = new TextField <String> ();
        m_deptAdmissionNameField.setFieldLabel ("在院科室");
        m_deptAdmissionNameField.setEnabled (false);

        m_chargeTypeName = new TextField <String> ();
        m_chargeTypeName.setFieldLabel ("费别");
        m_chargeTypeName.setEnabled (false);

        m_watchTimesForDisplay = new TextField <String> ();
        m_watchTimesForDisplay.setFieldLabel ("就诊次数");
        m_watchTimesForDisplay.setEnabled (false);

        m_deptAdmissionDays = new TextField <Integer> ();
        m_deptAdmissionDays.setFieldLabel ("在科天数");
        m_deptAdmissionDays.setEnabled (false);
    }

    public void removeAll ()
    {
        m_beginField.setValue (null);
        m_endField.setValue (null);
        m_patiNameField.setValue (null);
        m_patiIdForDisplayField.setValue (null);
        m_sexField.setValue (null);
        m_BedNoForDisplayField.setValue (null);
        m_deptAdmissionDateField.setValue (null);
        m_prepaidField.setValue (null);
        m_deptAdmissionNameField.setValue (null);
        m_chargeTypeName.setValue (null);
        m_watchTimesForDisplay.setValue (null);
        m_deptAdmissionDays.setValue (null);
        m_watchTimes.setValue (null);
        m_patiAdtComboBox.setValue (null);
        m_patiAdtListStore.removeAll ();
        m_patiInfoListStore.removeAll ();
        m_BedNoField.focus ();
    }

    /**
     * 获取患者ID 展示用
     * 
     * @return
     */
    public TextField <String> getPatiIdForDisplayField ()
    {
        return m_patiIdForDisplayField;
    }

    /**
     * 获取床号 展示用
     * 
     * @return
     */
    public TextField <String> getBedNoForDisplayField ()
    {
        return m_BedNoForDisplayField;
    }

    /**
     * 获取患者就诊次数 展示用
     * 
     * @return
     */
    public TextField <String> getWatchTimesForDisplay ()
    {
        return m_watchTimesForDisplay;
    }

    /**
     * 获取病人姓名控件
     * 
     * @return
     */
    public TextField <String> getPatiNameField ()
    {
        return m_patiNameField;
    }

    /**
     * 获取结束时间框
     * 
     * @return
     */
    public DateField getBeginField ()
    {
        return m_beginField;
    }

    /**
     * 获取开始时间框
     * 
     * @return
     */
    public DateField getEndField ()
    {
        return m_endField;
    }

    /**
     * 获取病人ID控件
     * 
     * @return
     */
    public TextField <String> getPatiIdField ()
    {
        return m_patiIdField;
    }

    /**
     * 获取性别控件
     * 
     * @return
     */
    public TextField <String> getSexField ()
    {
        return m_sexField;
    }

    /**
     * 获取床号
     * 
     * @return
     */
    public TextField <String> getBedNoField ()
    {
        return m_BedNoField;
    }

    /**
     * 获取入科时间
     * 
     * @return
     */
    public TextField <String> getDeptAdmissionDateField ()
    {
        return m_deptAdmissionDateField;
    }

    /**
     * 获取在院科室
     * 
     * @return
     */
    public TextField <String> getDeptAdmissionNameField ()
    {
        return m_deptAdmissionNameField;
    }

    /**
     * 获取费别
     * 
     * @return
     */
    public TextField <String> getChargeTypeName ()
    {
        return m_chargeTypeName;
    }

    /**
     * 获取就诊次数
     * 
     * @return
     */
    public ComboBox <InpPhamApplyPatInfoModel> getWatchTimes ()
    {
        return m_watchTimes;
    }

    /**
     * 获取入科天数
     * 
     * @return
     */
    public TextField <Integer> getDeptAdmissionDays ()
    {
        return m_deptAdmissionDays;
    }

    /**
     * 获取预交金
     * 
     * @return
     */
    public TextField <Double> getPrepaidField ()
    {
        return m_prepaidField;
    }

    /**
     * 获取 患者所在病区 ComboBox
     * 
     * @return
     */
    public ComboBox <PtsPaiAdtLogModel> getPatiAdtComboBox ()
    {
        return m_patiAdtComboBox;
    }

    /**
     * 获取 患者所在病区 ListStore
     * 
     * @return
     */
    public ListStore <PtsPaiAdtLogModel> getPatiAdtListStore ()
    {
        return m_patiAdtListStore;
    }

    /**
     * 获取 患者就诊次数ListStore
     * 
     * @return
     */
    public ListStore <InpPhamApplyPatInfoModel> getPatiInfoListStore ()
    {
        return m_patiInfoListStore;
    }

}
